-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-279336: Avoid that squashing overrides hideFromChangelog #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one open question, the other comments are not blocking
// EntryMappings groups entries by ID and then by OperationID and returns a Map[changeCode, Map[operationId, List[oasdiffEntry]]] | ||
func newEntriesMapPerIDAndOperationID(entries []*OasDiffEntry) map[string]map[string][]*OasDiffEntry { | ||
result := make(map[string]map[string][]*OasDiffEntry) | ||
func newEntriesMapPerIDAndOperationID(entries []*OasDiffEntry) (result, hiddenResult map[string]map[string][]*OasDiffEntry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you update the function comment to include the new returned map?
if _, exists := hiddenResult[code]; !exists { | ||
hiddenResult[code] = make(map[string][]*OasDiffEntry) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you create a new entry in the map only if there is at least one entry hidden? if yes., you add this inside the hidden if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could but the way its being done for the visible ones is like this, both end up adding the code into the map before, even if there are no entries. in that case I can do that for both, I just wasn't sure if this statement existed to cover some corner case I'm not aware of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm making the change and not finding any failures so lets try that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed changes
Jira ticket: CLOUDP-279336
Similar to this: https://github.com/10gen/mms/blob/2bdd398c7ede9d7d1e58519c6931fb1dbae13a36/scripts/api_versioning/changelog/generate_changelog.py#L197-L204
As part of investigating exemptions, I also noticed we weren't accounting for hiddenFromChangelog values while squashing, which could end up overriding the hide value. I'm following a similar logic to the one in current changelog above to fix it and updated all tests.
Checklist
Changes to Spectral
Further comments